﻿@model GraduateManagement.Models.StudentViewModel
@{
    ViewBag.Title = "学生信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2 style ="font-family: 微软雅黑;">@ViewBag.Title</h2>

<div>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.accountNum)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.accountNum)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.name)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.name)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.academy)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.academy)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.progress)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.progress)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.attachmentAddr)
        </dt>

        @if (Model.attachmentAddr == null)
        {
            <dd>
                请上传附件
            </dd>
            using (Html.BeginForm("Uploads", "Student", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
            {
                @Html.AntiForgeryToken()
                @Html.ValidationSummary("", new { @class = "text-danger" })
                <div class="form-group">
                    <label class="col-md-2 control-label">上传附件</label>
                    <div class="col-md-10">
                        <input type="file" id="upload-doc1" name="upload-doc" class="col-md-5" style="margin-top: 40px; margin-bottom: 40px; padding-top: 5px;">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" class="btn btn-primary" value="保存" />
                    </div>
                </div>
            }
        }
        else
        {
            string fileName = Model.attachmentName;
            <dd>
                <a href=@Model.attachmentAddr>@fileName</a>
            </dd>
        }
    </dl>   
</div>